# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-fastdiff
pkgver=0.3.0
pkgrel=5
pkgdesc="A fast native implementation of diff algorithm with a pure Python fallback"
url="https://github.com/syrusakbary/fastdiff"
arch="noarch"
license="MIT"
depends="python3"
makedepends="
	py3-pytest-runner
	py3-setuptools
	py3-gpep517
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://pypi.python.org/packages/source/f/fastdiff/fastdiff-$pkgver.tar.gz"
options="!check" # Requires unpackaged native modules
builddir="$srcdir/fastdiff-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl
}

sha512sums="
dae82cb779dd869cef4e4e258e69f1d0cc2e4b177514fb4136f42f78273f20be45e71fad987c5b5632e95fa3a3bf61f5983f53c17d00b67cb079b403327e63ce  fastdiff-0.3.0.tar.gz
"
